# Scrapy settings for zhihu_project project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
#     https://docs.scrapy.org/en/latest/topics/settings.html
#     https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
#     https://docs.scrapy.org/en/latest/topics/spider-middleware.html

BOT_NAME = 'zhihu_project'

SPIDER_MODULES = ['zhihu_project.spiders']
NEWSPIDER_MODULE = 'zhihu_project.spiders'


# Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = 'zhihu_project (+http://www.yourdomain.com)'

# Obey robots.txt rules
ROBOTSTXT_OBEY = False
# Configure maximum concurrent requests performed by Scrapy (default: 16)
#CONCURRENT_REQUESTS = 32

# Configure a delay for requests for the same website (default: 0)
# See https://docs.scrapy.org/en/latest/topics/settings.html#download-delay
# See also autothrottle settings and docs
#DOWNLOAD_DELAY = 3
# The download delay setting will honor only one of:
#CONCURRENT_REQUESTS_PER_DOMAIN = 16
#CONCURRENT_REQUESTS_PER_IP = 16

# Disable cookies (enabled by default)
#COOKIES_ENABLED = False

# Disable Telnet Console (enabled by default)
#TELNETCONSOLE_ENABLED = False

# Override the default request headers:
DEFAULT_REQUEST_HEADERS = {
  'cookie': 'BAIDU_SSP_lcr=https://www.baidu.com/link?url=UlYcPL-r5T2rF0SW2f44Eq5bMZJMMnEnXwezEFaxPsmLpaZV3-Bsf7hBdp_5x3N4vJJDQEHXkKqF7yLuIBhBNa&wd=&eqid=da61171500062b61000000065f1d2239; SESSIONID=5mOQ2refHYWeIhKoSpFDbZW869ttKqigHJRZiBIBCJO; JOID=W1oQBEiaeOERpMLZC5Spt7OrzkoW4QqPZsz7kn3EGZxd4q2KXmybVEClztwNnlRvpJToxycaTepM99qUarFU1Ok=; osd=WlkVBkibe-QTpMPaDpaptrCuzEoX4g-NZs34l3_EGJ9Y4K2LXWmZVEGmy94Nn1dqppTpxCIYTetP8tiUa7JR1uk=; _zap=cba92da4-aaa1-4838-87e0-a98ab7a2cfc5; _xsrf=73ZCq5RR7szb0DDhptL8uM3TKvxy717R; d_c0="AACj3K4AFRCPThO69MCiJIDA2sLDCuJR7j0=|1569067372"; __utmc=51854390; __utmv=51854390.100-1|2=registration_date=20160511=1^3=entry_date=20160511=1; _ga=GA1.2.771051634.1569067378; l_n_c=1; n_c=1; tshl=; q_c1=cc9e7923b4ee4d4580dc24e154bb52d1|1603674498000|1569067377000; __utma=51854390.771051634.1569067378.1599536021.1605092788.4; __utmz=51854390.1605092788.4.2.utmcsr=zhihu.com|utmccn=(referral)|utmcmd=referral|utmcct=/topic/20004648/hot; capsion_ticket="2|1:0|10:1605096743|14:capsion_ticket|44:YzRlODhjMzA5ZjdiNGFkZjk1ODIxNDE3YmNlODkwZWU=|e0793be0b410cef684b463d1317e4c05218631a75f81e6fccf829f911ff1571e"; r_cap_id="M2RlMTQ1YmZmZjc3NGY5Njg4MWJiYWM2MjM4NDNlNjk=|1605096745|a7becd5ea088f91c09307e0acf0e6ab5a2810470"; cap_id="NGYxMjhkMWM1MWJiNDc2MmI2ZWU2NmY2YTY1NGE5ZjE=|1605096745|ad8647f9860889a0c1ad706f158717dc6f624bb2"; l_cap_id="OWQ2MWJiZWExY2YxNGQ4M2E0ZjhlOThkOTc2NmVjNjc=|1605096745|51c1ad08e262b87331b3dbaae3115fb6cec2cffd"; z_c0=Mi4xY0NVRkF3QUFBQUFBQUtQY3JnQVZFQmNBQUFCaEFsVk5NU09aWUFDTmZ1SndFZXZPTGV1b1JiYTRrYTNobkdpaUhn|1605096753|5a5f1e7945357c4d2c0fb6646392f0bcb2272aae; tst=r; SESSIONID=pulsb2LtTjzNBeXRLvleyBhN9Ir1CvTN5GknReUsRk0; JOID=VV0UAk0PswOFT_EjeAlgXyZB9bJvfcJv8SzBawxa233LCpV5LpNVt9xM9yd_djgbLwbFTpWC0lm8noevurWW9gg=; osd=UlwQAEoIsgeHSPYifAtnWCdF97VofMZt9ivAbw5d3HzPCJJ-L5dXsNtN8yV4cTkfLQHCT5GA1V69moWovbSS9A8=; Hm_lvt_98beee57fd2ef70ccdd5ca52b9740c49=1605622191,1605624473,1605625399,1605625592; Hm_lpvt_98beee57fd2ef70ccdd5ca52b9740c49=1605625979; KLBRSID=2177cbf908056c6654e972f5ddc96dc2|1605625986|1605621977',
  'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36',
}

# Enable or disable spider middlewares
# See https://docs.scrapy.org/en/latest/topics/spider-middleware.html
#SPIDER_MIDDLEWARES = {
#    'zhihu_project.middlewares.ZhihuProjectSpiderMiddleware': 543,
#}

# Enable or disable downloader middlewares
# See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
#DOWNLOADER_MIDDLEWARES = {
#    'zhihu_project.middlewares.ZhihuProjectDownloaderMiddleware': 543,
#}

# Enable or disable extensions
# See https://docs.scrapy.org/en/latest/topics/extensions.html
#EXTENSIONS = {
#    'scrapy.extensions.telnet.TelnetConsole': None,
#}

# Configure item pipelines
# See https://docs.scrapy.org/en/latest/topics/item-pipeline.html
#ITEM_PIPELINES = {
#    'zhihu_project.pipelines.ZhihuProjectPipeline': 300,
#}

# Enable and configure the AutoThrottle extension (disabled by default)
# See https://docs.scrapy.org/en/latest/topics/autothrottle.html
#AUTOTHROTTLE_ENABLED = True
# The initial download delay
#AUTOTHROTTLE_START_DELAY = 5
# The maximum download delay to be set in case of high latencies
#AUTOTHROTTLE_MAX_DELAY = 60
# The average number of requests Scrapy should be sending in parallel to
# each remote server
#AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0
# Enable showing throttling stats for every response received:
#AUTOTHROTTLE_DEBUG = False

# Enable and configure HTTP caching (disabled by default)
# See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings
#HTTPCACHE_ENABLED = True
#HTTPCACHE_EXPIRATION_SECS = 0
#HTTPCACHE_DIR = 'httpcache'
#HTTPCACHE_IGNORE_HTTP_CODES = []
#HTTPCACHE_STORAGE = 'scrapy.extensions.httpcache.FilesystemCacheStorage'
